Determining
Nonstandard Format Support
To see
whether a device supports a particular format (standard or nonstandard), you
can call the waveOutOpen
// Determines whether the specified waveform-audio
output device
// supports a specified waveform-audio format.
Returns
// MMSYSERR_NOERROR if the format is supported,
WAVEERR_BADFORMAT if
// the format is not supported, and one of the other
MMSYSERR_ error
// codes if there are other errors encountered in
opening the
// specified waveform-audio device.
MMRESULT IsFormatSupported(LPWAVEFORMATEX pwfx, UINT
uDeviceID)
{
return
(waveOutOpen(
NULL, // ptr can
be NULL for query
uDeviceID, // the device
identifier
pwfx, // defines requested format
NULL, // no
callback
NULL, // no
instance data
WAVE_FORMAT_QUERY)); // query
only, do not open device
}
This
technique for determining nonstandard format support also applies to
waveform-audio input devices. The only difference is that the waveInOpen
To determine
whether a particular waveform-audio data format is supported by any of the
waveform-audio devices in a system, use the technique illustrated in the
previous example, but specify the WAVE_MAPPER constant for the uDeviceID
parameter.